import {reqAddressInfo,reqOrderInfo,reqSubmitOrderInfo} from '@/api/index'
const actions= {
    async addressInfo({commit}){
        let result = await reqAddressInfo()
        
        if(result.code==200){
            commit('ADDRESSINFO',result.data)
        }

        
    },
    async getOrderInfo({commit}){
        let result = await reqOrderInfo()
        
        if(result.code==200){
            commit('GETORDERINFO',result.data)
        }
    },
    // async submitorder({commit},{tradeNo,data}){
    //     let result = await reqSubmitOrderInfo(tradeNo,data)
    //     console.log(result,2222)
        

    // }

}
const mutations = {
    ADDRESSINFO(state,value){
        state.address = value

    },
    GETORDERINFO(state,value){
        state.orderInfo = value
    }

}
const state = {
    address:[],
    orderInfo:{}

}
export default{
    actions,
    mutations,
    state
}